<?php
/**
 * 栏目操作
 *
 * @version        $Id: catalog_do.php 1 14:31 2010年7月12日Z tianya $
 * @package        DedeCMS.Administrator
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once(dirname(__FILE__).'/config.php');
if(empty($dopost))
{
    ShowMsg("对不起，请指定栏目参数！","catalog_main.php");
    exit();
}
$cid = empty($cid) ? 0 : intval($cid);
$unittype = empty($unittype) ? 0 : intval($unittype);
$channelid = empty($channelid) ? 0 : intval($channelid);

if($dopost=="uploadLitpic")
{
	$fname = $_GET['litpic'] ? $_GET['litpic'] : 'litpic';
    $upfile = AdminUpload($fname, 'imagelit', 0, true );
    if($upfile=='-1')
    {
        $msg = "<script language='javascript'>
                parent.document.getElementById('uploadwait').style.display = 'none';
                alert('你没指定要上传的文件或文件大小超过限制！');
            </script>";
    }
    else if($upfile=='-2')
    {
        $msg = "<script language='javascript'>
                parent.document.getElementById('uploadwait').style.display = 'none';
                alert('上传文件失败，请检查原因！');
            </script>";
    }
    else if($upfile=='0')
    {
        $msg = "<script language='javascript'>
                parent.document.getElementById('uploadwait').style.display = 'none';
                alert('文件类型不正确！');
            </script>";
    }
    else
    {
        $msg = "<script language='javascript'>
                    parent.document.getElementById('uploadwait').style.display = 'none';
                    parent.document.getElementById('{$_GET[picname]}').value = '{$upfile}';
                    if(parent.document.getElementById('{$_GET[divpicview]}'))
                    {
                        parent.document.getElementById('{$_GET[divpicview]}').style.width = '150px';
                        parent.document.getElementById('{$_GET[divpicview]}').innerHTML = \"<img src='{$upfile}' width='150' />\";
                    }
                </script>";
    }
    echo $msg;
    exit();
}